<?php

namespace App\Http\Requests\Admin;

use Illuminate\Foundation\Http\FormRequest;

class StudentResultRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'test_list_id' => 'required|numeric|exists:test_lists,id',
            'examination_id' => 'required|numeric|exists:examinations,id',
            'fraction' => 'required|numeric',
            'success_num' => 'required|numeric|lte:all_num',
            'already_num' => 'required|numeric|lte:all_num',
            'all_num' => 'required|numeric',
            'join_time' => 'required|string',
            'read_teacher_id' => 'sometimes|numeric',
            'submit_type' => 'required|numeric',
            'content' => 'nullable'
        ];
    }
}
